Linux下安装Oracle19c(亲测可用!真保姆级安装教程) 您所在的位置:网站首页 oracle 19c ojdbc6 Linux下安装Oracle19c(亲测可用!真保姆级安装教程)

Linux下安装Oracle19c(亲测可用!真保姆级安装教程)

2023-12-18 06:50| 来源: 网络整理| 查看: 265

Linux下安装Oracle19c(亲测可用)

我是自己下载好 安装oracle19c所需要的的依赖rpm,然后通过u盘copy到虚拟机下安装oracle19c的!需要下载以下几个压缩包;

下载链接如下:

链接: https://pan.baidu.com/s/1uAmhloft070U-OsgHaRxug 提取码: 7vss 复制这段内容后打开百度网盘手机App,操作更方便哦 –来自百度网盘超级会员v1的分享

在这里插入图片描述

第一步:把u盘中所需依赖复制到虚拟机主目录下新建一个oracle文件夹中; [root@localhost oracle]# ls base.zip oracle-database-ee-19c-1.0-1.x86_64.rpm oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm 第二步:在oracle文件夹下打开终端执行命令 [root@localhost oracle]# rpm -ivh oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm 警告:oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID ec551f03: NOKEY 错误:依赖检测失败: compat-libcap1 被 oracle-database-preinstall-19c-1.0-1.el7.x86_64 需要 compat-libstdc++-33 被 oracle-database-preinstall-19c-1.0-1.el7.x86_64 需要 glibc-devel 被 oracle-database-preinstall-19c-1.0-1.el7.x86_64 需要 ksh 被 oracle-database-preinstall-19c-1.0-1.el7.x86_64 需要 libaio-devel 被 oracle-database-preinstall-19c-1.0-1.el7.x86_64 需要 libstdc++-devel 被 oracle-database-preinstall-19c-1.0-1.el7.x86_64 需要 第三步:根据他需要的什么内容一个个进行下载:

[可能会报的错误]:

[root@localhost oracle]# yum install -y compat-libcap1 已加载插件:fastestmirror, langpacks /var/run/yum.pid 已被锁定,PID 为 21426 的另一个程序正在运行。 Another app is currently holding the yum lock; waiting for it to exit... 另一个应用程序是:PackageKit 内存:145 M RSS (488 MB VSZ) 已启动: Tue Aug 3 11:59:29 2021 - 04:00之前 状态 :睡眠中,进程ID:21426

这个时候不要慌!只是有一个进程把端口占用了!干掉他就完事!执行以下命令即可:

[root@localhost oracle]# rm -f /var/run/yum.pid

然后在执行以下刚才的命令,你会发现惊奇的成功了!

[root@localhost oracle]# yum install -y compat-libcap1 已加载插件:fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirrors.163.com * extras: mirrors.163.com * updates: mirrors.163.com 正在解决依赖关系 --> 正在检查事务 ---> 软件包 compat-libcap1.x86_64.0.1.10-7.el7 将被 安装 --> 解决依赖关系完成 依赖关系解决 ===================================================================================================================================================================================== Package 架构 版本 源 大小 ===================================================================================================================================================================================== 正在安装: compat-libcap1 x86_64 1.10-7.el7 base 19 k 事务概要 ===================================================================================================================================================================================== 安装 1 软件包 总下载量:19 k 安装大小:29 k Downloading packages: 警告:/var/cache/yum/x86_64/7/base/packages/compat-libcap1-1.10-7.el7.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY===============] 0.0 B/s | 19 kB --:--:-- ETA compat-libcap1-1.10-7.el7.x86_64.rpm 的公钥尚未安装 compat-libcap1-1.10-7.el7.x86_64.rpm | 19 kB 00:00:01 从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 检索密钥 导入 GPG key 0xF4A80EB5: 用户ID : "CentOS-7 Key (CentOS 7 Official Signing Key) " 指纹 : 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5 软件包 : centos-release-7-6.1810.2.el7.centos.x86_64 (@anaconda) 来自 : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 Running transaction check Running transaction test Transaction test succeeded Running transaction 正在安装 : compat-libcap1-1.10-7.el7.x86_64 1/1 验证中 : compat-libcap1-1.10-7.el7.x86_64 1/1 已安装: compat-libcap1.x86_64 0:1.10-7.el7 完毕!

接下来把上面所需要的包一个个下载:

[root@localhost oracle]# yum install -y compat-libstdc++-33 --------------------------------------------- [root@localhost oracle]# yum install -y glibc-devel --------------------------------------------- [root@localhost oracle]# yum install -y ksh --------------------------------------------- [root@localhost oracle]# yum install -y libaio-devel ----------------------------------------------- [root@localhost oracle]# yum install -y libstdc++-devel 第四步:执行命令(时间会有点长,不慌!) [root@localhost oracle]# rpm -ivh oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm ----------------------安装ing------------------------ 警告:oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID ec551f03: NOKEY 准备中... ################################# [100%] 正在升级/安装... 1:oracle-database-preinstall-19c-1.################################# [100%] 第五步:接着来执行命令 [root@localhost oracle]# rpm -ivh oracle-database-ee-19c-1.0-1.x86_64.rpm --------------------执行ing-------------------------- 警告:oracle-database-ee-19c-1.0-1.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID ec551f03: NOKEY 准备中... ################################# [100%] 正在升级/安装... 1:oracle-database-ee-19c-1.0-1 ################################# [100%] [INFO] Executing post installation scripts... [INFO] Oracle home installed successfully and ready to be configured. To configure a sample Oracle Database you can execute the following service configuration script as root: /etc/init.d/oracledb_ORCLCDB-19c configure [root@localhost oracle]# rpm -ivh oracle-database-ee-19c-1.0-1.x86_64.rpm 警告:oracle-database-ee-19c-1.0-1.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID ec551f03: NOKEY 准备中... ################################# [100%] 软件包 oracle-database-ee-19c-1.0-1.x86_64 已经安装 第六步:来一个稍长时间的命令(加载oracle19c环境) [root@localhost oracle]# /etc/init.d/oracledb_ORCLCDB-19c configure --------------------------------------------------- Configuring Oracle Database ORCLCDB. 准备执行数据库操作 已完成 8% 复制数据库文件 已完成 31% 正在创建并启动 Oracle 实例 已完成 32% 已完成 36% 已完成 40% 已完成 43% 已完成 46% 正在进行数据库创建 已完成 51% 已完成 54% 正在创建插接式数据库 已完成 58% 已完成 77% 执行配置后操作 已完成 100% 数据库创建完成。有关详细信息, 请查看以下位置的日志文件: /opt/oracle/cfgtoollogs/dbca/ORCLCDB。 数据库信息: 全局数据库名:ORCLCDB 系统标识符 (SID):ORCLCDB 有关详细信息, 请参阅日志文件 "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log"。 Database configuration completed successfully. The passwords were auto generated, you must change them by connecting to the database using 'sqlplus / as sysdba' as the oracle user. 第七步:切换oracle用户配置环境变量 [root@localhost oracle]# su - oracle

接着:

[oracle@localhost ~]$ vi ~/.bash_profile //在里面输入: export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1 export PATH=$PATH:/opt/oracle/product/19c/dbhome_1/bin export ORACLE_SID=ORCLCDB //写完后按住esc 输入冒号 wq 保存退出

接着:

[oracle@localhost ~]$ source ~/.bash_profile //目的是为了加载刚刚修改的变量

接着:

[oracle@localhost ~]$ sqlplus / as sysdba //管理员登录 SQL> alter user system identified by system; ?????? //修改system密码 SQL> create user test_lxx identified by test_lxx; create user test_lxx identified by test_lxx //创建test_lxx用户并设置密码为test_lxx SQL> grant dba to test_lxx; //为自己创建的用户赋予管理员权限 SQL> exit ? Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 ?? [oracle@localhost ~]$ lsnrctl start //打开监听器 [oracle@localhost ~]$ lsnrctl status //查看状态 第八步:打开PLSQL进行测试连接

在这里插入图片描述

总结:连接的时候报错信息: 连接超时问题解决: 1、检查是否开启监听, su oracle // 切换到Oracle账号 lsnrctl start //启动监听器命令 lsnrctl stop // 停止监听器命令 lsnrctl status // 查看监听器命令 2、检查防火墙状态(原来我的防火墙没关闭),关闭防火墙!

//查看防火墙状态 sudo systemctl status firewalld //查看后,看到active(running)就意味着防火墙打开了。 //关闭防火墙,命令为: sudo systemctl stop firewalld。 //关闭后查看是否关闭成功,如果看到inactive(dead)就意味着防火墙关闭了。

再尝试连接就成功了。



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有